<?php $base_path = Yii::app()->baseUrl; ?>
<?php
$location = $this->current_location;
if (!empty($location)) {
    $_GET['lname'] = $location->location_name . ' ' . $location->location_index;
}
?>
<div class="header-wrapp">
    <div class="header clearfix">
        <div class="header-top right">
            <ul class="right<?php if(empty($this->user)) echo ' none-border'; ?>">
            <li><a href="#">Post Your Resume</a> <span class="line"></span></li>
            <?php
            if (!empty($this->user)) {
                ?>
                <li class="user_profile">
                    <a href="<?php echo $this->createUrl('profile/index') ?>"><strong><?php echo $this->user['email'] ?></strong>
                        <span class="line"></span>
                    </a>
                    <div class="show-sub" style="display: none;">
                        <ul>
                            <li><a href="<?php echo $this->createUrl('profile/jobsearch') ?>">My Searches</a></li>
                            <li><a href="<?php echo $this->createUrl('profile/index') ?>">My Jobs</a></li>
                            <li><a href="<?php echo $this->createUrl('profile/emailalert') ?>">Alerts</a></li>
                            <li><a href="<?php echo $this->createUrl('profile/account') ?>">Account</a></li>
                        </ul>
                        <div class="sub-bot">
                            <strong><?php echo $this->user['email'] ?></strong>
                            <a href="<?php echo $this->createUrl('account/logout', array('dest' => base64_encode($_SERVER['REQUEST_URI']))); ?>">Logout</a>
                        </div>
                    </div>
                    <div style="clear: both;"></div>
                </li>
                <?php
            } else {
                ?>
                <li><a href="<?php echo $this->createUrl('account/login', array('dest' => base64_encode($_SERVER['REQUEST_URI']))); ?>">Login</a></li>
                <?php
            }
            ?>
        </ul>
        </div>
        <div class="left">
            <a href="<?php echo $base_path . '/'; ?>" class="logo"><img src="<?php echo $base_path ?>/images/logo.gif" width="173" height="35" alt="" /></a>
            <form id="search_header" name="" action="<?php echo $base_path ?>/search/result/" method="GET" class="left">
                <div class="keyword-loca">
                    <label>Keyword</label>
                    <input type="text" value="<?php echo $_GET['kw']; ?>" name="kw" id="kw_suggest_header" />
                </div>
                <div class="keyword-loca">
                    <label>Location</label>
                    <input type="text" name="lname" value="<?php echo $_GET['lname']; ?>" id="local_suggest_header" />                    
                </div>            
                <div class="button-set">
                    <button type="submit"><span><span>Search all job</span></span></button>
                    <a href="<?php echo $this->createUrl('search/advanced'); ?>">Advanced job search</a>
                </div>
                <input type="hidden" name="submit" value="submit" />
            </form>    
        </div>
    </div>
</div>